//
//  AXFFeedbackController.m
//  BeeQuick
//
//  Created by 王誉升 on 2016/11/24.
//  Copyright © 2016年 six_group. All rights reserved.
//

#import "AXFFeedbackController.h"
#import "AXFTypeView.h"
#import "AXFMiddleView.h"

@interface AXFFeedbackController ()

@end

@implementation AXFFeedbackController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}

- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:YES];
    
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;
}

- (void)setupUI
{
    self.view.backgroundColor = [UIColor colorWithRed:246/256.0 green:246/256.0 blue:(246/256.0) alpha:1];
    
    AXFTypeView *topView = [[[NSBundle mainBundle]loadNibNamed:@"AXFTypeView" owner:nil options:nil] lastObject];
    
    [self.view addSubview:topView];
    
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.view).offset(74);
        
        make.left.right.equalTo(self.view);
        
        make.height.offset(120);
        
    }];
    
    AXFMiddleView *middleView = [[[NSBundle mainBundle]loadNibNamed:@"AXFMiddleView" owner:nil options:nil] lastObject];
    
    [self.view addSubview:middleView];
    
    [middleView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(topView.mas_bottom).offset(10);
        
        make.left.right.equalTo(self.view);
        
        make.height.offset(200);
        
    }];
    
    UIButton *belowBt = [[UIButton alloc]init];
    
    belowBt.backgroundColor = [UIColor yellowColor];
    
    [belowBt setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    [belowBt setTitle:@"确认提交" forState:UIControlStateNormal];
    
    [self.view addSubview:belowBt];
    
    [belowBt mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(middleView.mas_bottom).offset(30);
        
        make.centerX.equalTo(self.view);
        
        make.width.offset(335);
        
    }];

    
    //自定义导航条返回按钮
    UIBarButtonItem *leftBarB = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"v2_goback"] style:UIBarButtonItemStylePlain target:self action:@selector(clickToFeedBack:)];
    
    self.navigationItem.leftBarButtonItem = leftBarB;
}

- (void)clickToFeedBack:(UIBarButtonItem *)batBtn
{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
